package com.dc;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.ibatis.sqlmap.client.SqlMapClient;

public class Main {
	public static void main(String[] args) throws Exception{
		//insert();
		update();
		
//		CountDownLatch countDownLatch = new CountDownLatch(2);
//		ExecutorService executorService=Executors.newFixedThreadPool(2);
//		executorService.execute(new A(countDownLatch));
//		executorService.execute(new B(countDownLatch));
//		System.out.println("Exit");
//		executorService.shutdown();
	}

	private static void update() throws Exception {
		SqlMapClient client = DBUtil.getClient();
		Map<String,String> updateMap = new HashMap<String,String>();
		updateMap.put("id", "1");
		updateMap.put("name", "ab1");
		client.update("dc.updateStu", updateMap);
	}

	private static void insert() throws Exception {
		SqlMapClient client = DBUtil.getClient();
		Map<String,String> stuMap = new HashMap<String,String>();
		stuMap.put("id", "2");
		stuMap.put("name", "ab2");
		client.insert("dc.insertStu", stuMap);
	}

}
